﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;

namespace LunarSF.SHomeWorkshop.LunarMarkdownEditor
{
    public class CheckBoxItem : ListBoxItem
    {
        public CheckBoxItem()
        {
            this.Content = checkBox;
        }

        protected CheckBox checkBox = new CheckBox() { Margin = new System.Windows.Thickness(4, 2, 4, 2), };

        public bool? IsChecked
        {
            get { return checkBox.IsChecked; }
            set { checkBox.IsChecked = value; }
        }

        public string Title
        {
            get { return checkBox.Content as string; }
            set
            {
                if (value.StartsWith("_"))
                    checkBox.Content = "_" + value;
                else checkBox.Content = value;
            }
        }
    }
}
